/** 品牌列表功能模块 */
export const pinPaiModuleMixin = {
	data() {
		return {
			isShowMorePinpai: false, // 是否显示更多品牌
			showPinpaiData: [], // 显示的品牌
			pinPaiData: [],
			pinPaiLoading: true,
			minPinpaiLength: 6,
			isHaveMorePinpai: false, // 是否拥有更多品牌
			apiPinpai: "",
			screen_id: "",
		}
	},
	created() { this.getpinPaiFn(); },
	methods: {
		/** 获取品牌数据 */
		async getpinPaiFn() {
			this.pinPaiLoading = true;
			try {
				const res = await this.$post('6544df66483e9', {});
				this.pinPaiData = res.data || [];
				this.showPinpaiData = this.pinPaiData.slice(0, this.minPinpaiLength);
				this.isHaveMorePinpai = this.pinPaiData.length > this.minPinpaiLength;
			} catch (e) {}
			this.pinPaiLoading = false;
		},
		/** 改变品牌显示更多 */
		isShowPinpaiMoreFn() {
			if (this.isShowMorePinpai) this.showPinpaiData = this.pinPaiData.slice(0, this.minPinpaiLength)
			else this.showPinpaiData = this.pinPaiData;
			this.isShowMorePinpai = !this.isShowMorePinpai;
		},
	}
};